import request from '@/axios/axios'

// 获取固件类型
export function firmwareType(query) {
  return request({
    url: '/ota/v1/firmware/info/get-firmware-type-list',
    method: 'post',
    data: query
  })
}


// 新建固件
export function addFirmware(query) {
  return request({
    url: '/ota/v1/component/info/add',
    method: 'post',
    data: query
  })
}

// 新建固件版本
export function addFirmwareInfo(query) {
  return request({
    url: '/ota/v1/component/info/add-firmware-info',
    method: 'post',
    data: query
  })
}

// 固件管理列表
export function getComponentList(query) {
  return request({
    url: '/ota/v1/component/info/get-component-list',
    method: 'post',
    data: query
  })
}

// 固件管理列表数据删除
export function deleteManageList(query) {
  return request({
    url: '/ota/v1/component/info/delete',
    method: 'post',
    data: query
  })
}

// 获取固件版本列表
export function getFirmwareVersionList(query) {
  return request({
    url: '/ota/v1/component/info/get-firmware-version-list',
    method: 'post',
    data: query
  })
}

// 编辑固件版本
export function updateFirmwareVersion(query) {
  return request({
    url: '/ota/v1/component/info/update-firmware-version',
    method: 'post',
    data: query
  })
}

// 删除固件详情固件版本数据
export function deleteFirmwareVersion(query) {
  return request({
    url: '/ota/v1/component/info/delete-firmware-version',
    method: 'post',
    data: query
  })
}

// 固件版本上下架
export function firmwareVersionRelease(query) {
  return request({
    url: '/ota/v1/component/info/firmware-version-release',
    method: 'post',
    data: query
  })
}

// 获取固件详情
export function getComponentInfo(query) {
  return request({
    url: '/ota/v1/component/info/get-component-info',
    method: 'post',
    data: query
  })
}

// 编辑固件基本信息
export function updateComponentInfo(query) {
  return request({
    url: '/ota/v1/component/info/update',
    method: 'post',
    data: query
  })
}

// 上架或修改上架范围限定范围添加产品校验
export function addProductCheck(query) {
  return request({
    url: '/ota/v1/component/info/add-product-check',
    method: 'post',
    data: query
  })
}

// 获取上架固件版本信息
export function getFirmwareVersionDetail(query) {
  return request({
    url: '/ota/v1/component/info/get-firmware-version-detail',
    method: 'post',
    data: query
  })
}

// 上架固件版本或修改上架范围
export function modifyFirmwareVersionRange(query) {
  return request({
    url: '/ota/v1/component/info/modify-firmware-version-range',
    method: 'post',
    data: query
  })
}

// 关联产品列表
export function getProductListByComponent(query) {
  return request({
    url: '/ota/v1/component/info/get-product-list-by-component',
    method: 'post',
    data: query
  })
}

// 固件开发列表
export function getProductComponentRelationList(query) {
  return request({
    url: 'ota/v1/component/info/get-product-component-relation-list',
    method: 'post',
    data: query
  })
}

// 选择关联固件
export function bindComponent(query) {
  return request({
    url: '/ota/v1/component/info/bind-component',
    method: 'post',
    data: query
  })
}

// 变更更版本列表
export function getChangeVersionList(query) {
  return request({
    url: '/ota/v1/component/info/get-change-version-list',
    method: 'post',
    data: query
  })
}

// 选择变更更版
export function changeVersion(query) {
  return request({
    url: '/ota/v1/component/info/change-version',
    method: 'post',
    data: query
  })
}

// 更新固件发布状态
export function updateProductComponentReleaseStatus(query) {
  return request({
    url: '/ota/v1/component/info/update_product_component_release_status',
    method: 'post',
    data: query
  })
}

// 固件解除绑定
export function unbindComponent(query) {
  return request({
    url: '/ota/v1/component/info/unbind-component',
    method: 'post',
    data: query
  })
}

